package com.taotao.portal.controller;

import com.taotao.portal.service.AdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author hong.zheng
 * @Description
 * @date 2018-09-07-9:55
 **/
@Controller
public class PageController {

    @Autowired
    private AdService adService;

    @RequestMapping("/index")
    public String showIndex(ModelMap modelMap) throws Exception {
        String adResult = adService.getAdItemList();
        modelMap.addAttribute("ad1", adResult);
        return "index";
    }

}